home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Workbench Add-On
/
Workbench Add-On - Volume 1.iso
/
Dev
/
Oberon
/
source
/
amiga
/
SCSIDisk.mod
< prev
next >
Wrap
Text File
|
1995-06-29
|
5KB
|
139 lines
(**************************************************************************
$RCSfile: SCSIDisk.mod $
Description: SCSI command definitions
Created by: fjc (Frank Copeland)
$Revision: 3.8 $
$Author: fjc $
$Date: 1995/06/04 23:13:14 $
$VER: scsidisk.h 36.2 (7.11.90)
Includes Release 40.15
(C) Copyright 1985-1993 Commodore-Amiga, Inc.
All Rights Reserved
Oberon-A interface Copyright © 1994-1995, Frank Copeland.
This file is part of the Oberon-A Interface.
See Oberon-A.doc for conditions of use and distribution.
***************************************************************************)
<* STANDARD- *>
MODULE [2] SCSIDisk;
IMPORT e := Exec, s := Sets;
(*
**
** SCSI exec-level device command
**
*)
(* --------------------------------------------------------------------
*
* SCSI Command
* Several Amiga SCSI controller manufacturers are converging on
* standard ways to talk to their controllers. This include
* file describes an exec-device command (e.g. for hddisk.device)
* that can be used to issue SCSI commands
*
* UNIT NUMBERS
* Unit numbers to the OpenDevice call have encoded in them which
* SCSI device is being referred to. The three decimal digits of
* the unit number refer to the SCSI Target ID (bus address) in
* the 1's digit, the SCSI logical unit (LUN) in the 10's digit,
* and the controller board in the 100's digit.
*
* Examples:
* 0 drive at address 0
* 12 LUN 1 on multiple drive controller at address 2
* 104 second controller board, address 4
* 88 not valid: both logical units and addresses
* range from 0..7.
*
* CAVEATS
* Original 2090 code did not support this command.
*
* Commodore 2090/2090A unit numbers are different. The SCSI
* logical unit is the 100's digit, and the SCSI Target ID
* is a permuted 1's digit: Target ID 0..6 maps to unit 3..9
* (7 is reserved for the controller).
*
* Examples:
* 3 drive at address 0
* 109 drive at address 6, logical unit 1
* 1 not valid: this is not a SCSI unit. Perhaps
* it's an ST506 unit.
*
* Some controller boards generate a unique name (e.g. 2090A's
* iddisk.device) for the second controller board, instead of
* implementing the 100's digit.
*
* There are optional restrictions on the alignment, bus
* accessability, and size of the data for the data phase.
* Be conservative to work with all manufacturer's controllers.
*
*------------------------------------------------------------------*)
CONST
scsiCmd * = 28; (* issue a SCSI command to the unit *)
(* ioData points to a SCSICmd *)
(* ioLength is SIZE (SCSICmd) *)
(* ioActual and ioOffset are not used *)
TYPE
SCSICmdPtr * = POINTER TO SCSICmd;
SCSICmd * = RECORD
data * : e.APTR; (* word aligned data for SCSI Data Phase *)
(* (optional) data need not be byte aligned *)
(* (optional) data need not be bus accessable *)
length * : e.ULONG; (* even length of Data area *)
(* (optional) data can have odd length *)
(* (optional) data length can be > 2**24 *)
actual * : e.ULONG; (* actual Data used *)
command * : e.APTR; (* SCSI Command (same options as Data) *)
cmdLength * : e.UWORD; (* length of Command *)
cmdActual * : e.UWORD; (* actual Command used *)
flags * : s.SET8; (* includes intended data direction *)
status * : SHORTINT; (* SCSI status of command *)
senseData * : e.APTR; (* sense data: filled if [OLD]AUTOSENSE *)
(* is set and Status has CHECK CONDITION *)
(* (bit 1) set *)
senseLength * : e.UWORD; (* size of SenseData, also bytes to *)
(* request w/ AUTOSENSE, must be 4..255 *)
senseActual * : e.UWORD; (* amount actually fetched (0 means no sense) *)
END; (* SCSICmd *)
CONST
(* ----- scsiFlags -----*)
write * = {}; (* intended data direction is out *)
read * = 0; (* intended data direction is in *)
readWrite * = 0; (* (the bit to test) *)
noSense * = {}; (* no automatic request sense *)
autoSense * = 1; (* do standard extended request sense *)
(* on check condition *)
oldAutoSense * = 2; (* do 4 byte non-extended request *)
(* sense on check condition *)
(* ----- SCSI ioError values -----*)
selfUnit * = 40; (* cannot issue SCSI command to self *)
dma * = 41; (* DMA error *)
phase * = 42; (* illegal or unexpected SCSI phase *)
parity * = 43; (* SCSI parity error *)
selTimeout * = 44; (* Select timed out *)
badStatus * = 45; (* status and/or sense error *)
(* ----- OpenDevice ioError values -----*)
noBoard * = 50; (* Open failed for non-existant board *)
END SCSIDisk.